Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: impl QueryFinalityProviderHasPower in consumer chain #44

Merged

Conversation

bournezjc
Copy link

Summary

context in #496
This pr implements the logic of querying voting power in Op.

instead of querying the exact voting power, the FP queries BTC delegations page by page, and if there is >=1 active BTC delegation, then it can vote.

Test plan

make test-e2e-op

@bournezjc bournezjc force-pushed the bourne/dev-consumer-chain-support branch from 15c6e06 to 2b3308e Compare August 28, 2024 07:01
@bournezjc bournezjc marked this pull request as ready for review August 28, 2024 07:04
Comment on lines 550 to 556
btcstakingParams, err := cc.bbnClient.QueryClient.BTCStakingParams()
if err != nil {
return false, err
}

covQuorum := btcstakingParams.GetParams().CovenantQuorum
ud := btcDel.UndelegationResponse
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this never changes and the isDelegationActive function will be called upon every BTC delegation, how about we pass btcstakingParams as an argument to isDelegationActive rather than querying it everytime?

@bournezjc bournezjc merged commit 6455f49 into base/consumer-chain-support Aug 29, 2024
3 of 8 checks passed
@lesterli lesterli deleted the bourne/dev-consumer-chain-support branch September 3, 2024 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants